import requests
import kuser_agent as kua
import lxml.etree as le
import ktool
# 获取2级页面源码
content = requests.get(
    url = 'https://jobs.51job.com/beijing/129077365.html?s=01&t=0',
    headers = {'User-Agent':kua.get()}
).content

# 使用lxml做数据提取
texts = le.HTML(content).xpath('//div[@class="bmsg job_msg inbox"]/text()')
print(texts)

text = '\n'.join(texts).strip()
print(text)

